<script>
<?php
include_once("PHP/PostContainer.php");
include_once("PHP/reddit.php");
include_once("PHP/4chanParser.php");
require_once('simpletest/autorun.php');

//Simple Unit tests with xml file covering rendudant xml data as well as valid information
class ParseReddit extends UnitTestCase {
//covers Code coverage for data as well as constructor
    function testCreatesNewObj() {
        $con = new PostContainer();
		$r = new RedditParser();
		
        $this->assertTrue($r->url == 'http://www.reddit.com');
    }

        function testPopulate() {
            $con = new PostContainer();
			$con->addParser(new RedditParser());
			$con->populatePosts();
            $this->assertTrue(sizeof($con->posts)==25);
        }
}

class Parse4chanTest extends UnitTestCase {
//covers Code coverage for data as well as constructor
        function testCreatesNewObj() {
        $con = new PostContainer();
		$r = new forchanParser();
		
        $this->assertTrue($r->url == 'http://boards.4chan.org/v/');
    }

        function testPopulate() {
            $con = new PostContainer();
			$con->addParser(new forchanParser());
			$con->populatePosts();
            $this->assertTrue(sizeof($con->posts)==15);
        }
}

?>
</script>